package br.com.season.collections;

import java.util.ArrayList;
import java.util.List;

public class CustomerTesteArrayList {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		List customerRef = new ArrayList();
		for (int i=0; i<200; i++) {
			customerRef.add(new Customer(i, "Customer"+i));
		}
		
		customerRef.add(14, new Customer(23434, "Zé das Coves"));
		customerRef.set(52, new Customer(2343552, "Zé das Alface"));
		
		for (int i=0; i<customerRef.size(); i++) {
			Customer customer = (Customer) customerRef.get(i);
			System.out.println(customerRef);
		}
		
		for ( Object objCustomer : customerRef) {
			Customer customer = (Customer) objCustomer;
			System.out.println(customerRef);
		}
		
		System.out.println("----------------------------------------");
		
		if ( customerRef.indexOf(new Customer(23434, "Zé das Coves"))>0){
			System.out.println("Caraca Achei ...");
			
		}else{
			System.out.println("Putz....deu pau ...");
		}
		
	}

}
